package com.netistate.pojo;

import java.util.List;
import java.util.Set;

import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;

import org.hibernate.annotations.Cache;
import org.hibernate.annotations.CacheConcurrencyStrategy;

@Entity
@Table(name="t_project")
@Cache(usage=CacheConcurrencyStrategy.READ_WRITE)
public class Project {

	private int id;
	private String projectName;
	private String alias;
	private String projectManager;
	private String descr;
	private String createtime;
	private String projectProcess;
	private String clientName;
	private String clientAddress;
	private String projectMember;
	
	private List<ProjectBlog> projectBlogList;
	private List<Doc> docList;
	private List<TechNote> techNoteList;
	private List<Sale> saleList;
	
	private Set<Labor> laborList;
	private Set<ClientContact> clientContactList;
	
	private Set<Product> productList;
	private Set<Demo> demoSet;
	
	private List<ProjectServices> projectServiceList;
	
	@OneToMany(mappedBy="project")
	public List<ProjectServices> getProjectServiceList() {
		return projectServiceList;
	}
	public void setProjectServiceList(List<ProjectServices> projectServiceList) {
		this.projectServiceList = projectServiceList;
	}
	//private List<User> userList;
	private List<UserProject> userProjectList;
	
	@OneToMany(mappedBy="project")
	public List<UserProject> getUserProjectList() {
		return userProjectList;
	}
	public void setUserProjectList(List<UserProject> userProjectList) {
		this.userProjectList = userProjectList;
	}
	
	//n:n
	/*@ManyToMany(mappedBy="projectList")
	public List<User> getUserList() {
		return userList;
	}
	public void setUserList(List<User> userList) {
		this.userList = userList;
	}*/
	
	
	//1:n
	@OneToMany(mappedBy="project")
	public List<Sale> getSaleList() {
		return saleList;
	}
	public void setSaleList(List<Sale> saleList) {
		this.saleList = saleList;
	}
	//.......
	
	@OneToMany(mappedBy="project")
	public List<TechNote> getTechNoteList() {
		return techNoteList;
	}
	public void setTechNoteList(List<TechNote> techNoteList) {
		this.techNoteList = techNoteList;
	}
	/*@OneToMany(mappedBy="project")
	public List<Product> getProductList() {
		return productList;
	}
	public void setProductList(List<Product> productList) {
		this.productList = productList;
	}*/
	
	@OneToMany(mappedBy="project",cascade={CascadeType.ALL},fetch=FetchType.LAZY)
	public Set<Demo> getDemoSet() {
		return demoSet;
	}
	public void setDemoSet(Set<Demo> demoSet) {
		this.demoSet = demoSet;
	}
	@OneToMany(mappedBy="project",cascade={CascadeType.ALL},fetch=FetchType.LAZY)
	public Set<Product> getProductList() {
		return productList;
	}
	
	public void setProductList(Set<Product> productList) {
		this.productList = productList;
	}
	
	@OneToMany(mappedBy="project",cascade={CascadeType.ALL},fetch=FetchType.LAZY)
	public Set<ClientContact> getClientContactList() {
		return clientContactList;
	}
	public void setClientContactList(Set<ClientContact> clientContactList) {
		this.clientContactList = clientContactList;
	}
	@OneToMany(mappedBy="project",cascade={CascadeType.ALL},fetch=FetchType.LAZY)
	public Set<Labor> getLaborList() {
		return laborList;
	}
	public void setLaborList(Set<Labor> laborList) {
		this.laborList = laborList;
	}
	
	@OneToMany(mappedBy="project")
	public List<Doc> getDocList() {
		return docList;
	}
	public void setDocList(List<Doc> docList) {
		this.docList = docList;
	}
	@OneToMany(mappedBy="project")
	public List<ProjectBlog> getProjectBlogList() {
		return projectBlogList;
	}
	public void setProjectBlogList(List<ProjectBlog> projectBlogList) {
		this.projectBlogList = projectBlogList;
	}
	
	
	
	//get set
	@Id
	@GeneratedValue(strategy=GenerationType.IDENTITY)
	public int getId() {
		return id;
	}
	
	public void setId(int id) {
		this.id = id;
	}
	public String getProjectName() {
		return projectName;
	}
	public void setProjectName(String projectName) {
		this.projectName = projectName;
	}
	public String getProjectManager() {
		return projectManager;
	}
	public void setProjectManager(String projectManager) {
		this.projectManager = projectManager;
	}
	public String getDescr() {
		return descr;
	}
	public void setDescr(String descr) {
		this.descr = descr;
	}
	public String getCreatetime() {
		return createtime;
	}
	public void setCreatetime(String createtime) {
		this.createtime = createtime;
	}
	public String getProjectProcess() {
		return projectProcess;
	}
	public void setProjectProcess(String projectProcess) {
		this.projectProcess = projectProcess;
	}
	public String getClientName() {
		return clientName;
	}
	public void setClientName(String clientName) {
		this.clientName = clientName;
	}
	public String getClientAddress() {
		return clientAddress;
	}
	public void setClientAddress(String clientAddress) {
		this.clientAddress = clientAddress;
	}
	public String getProjectMember() {
		return projectMember;
	}
	public void setProjectMember(String projectMember) {
		this.projectMember = projectMember;
	}
	public String getAlias() {
		return alias;
	}
	public void setAlias(String alias) {
		this.alias = alias;
	}
	
	
}
